com.highdeal.pnr.hci
Class ParameterModel

java.lang.Object
  extended by com.highdeal.pnr.hci.ParameterModel
All Implemented Interfaces:
XMLMarshallable

public class ParameterModel
extends java.lang.Object
implements XMLMarshallable

This class represents the description of a parameter. Each parameter description specifies a type for the parameter. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="parameter">
   <xs:complexType>
     <xs:sequence>
        <xs:element ref="additionalInformation" minOccurs="0" maxOccurs="unbounded" />
     </xs:sequence>
     <xs:attribute name="name" type="xs:string" use="required"/>
     <xs:attribute name="description" type="xs:string"/>
     <xs:attribute name="value" type="xs:string" />
     <xs:attribute name="type" type="ParameterType" default="string"/>
     <xs:attribute name="isPrivate" type="xs:boolean" default="false"/>
     <xs:attribute name="parameterName" type="xs:string"/>
   </xs:complexType>
 </xs:element>

 <xs:simpleType name="ParameterType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="number"/>
      <xs:enumeration value="string"/>
      <xs:enumeration value="date"/>
   </xs:restriction>
 </xs:simpleType>


Field Summary
static java.lang.String TAG_NAME
          The value of that constant is the XML tag name of the parameter.
 
Constructor Summary
ParameterModel()
          Builds an empty ParameterModel.
ParameterModel(java.lang.String name, int type, boolean isPrivate)
          Builds a ParameterModel.
ParameterModel(java.lang.String name, java.lang.String description, int type, java.lang.Object value, boolean isPrivate, java.lang.String parameterName)
          Builds a ParameterModel.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String name, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 boolean checkValidity()
          Tests if the parameter is valid (non void name, incompatible type, value...).
 ParameterModel duplicate()
          Returns a clone of the parameter.
 java.util.List<AdditionalInfoModel> getAdditionalInfoList()
          Gets the list of Additional Informations.
 java.util.Date getDateValue()
          Returns the parameter default value seen as a Date if it is possible.
 java.lang.String getDescription()
          Returns the description of this parameter.
 java.lang.String getName()
          Returns the name of the parameter.
 java.math.BigDecimal getNumberValue()
          Returns the parameter default value seen as a BigDecimal if it is possible.
 java.lang.String getParameterName()
          Returns the mapped parameter name.
 java.lang.String getStringValue()
          Returns the parameter default value seen as a String if it is possible.
 int getType()
          Returns the type of the parameter.
 java.lang.Object getValue()
          Returns the parameter value.
 boolean isPrivate()
          Returns the visibility of the parameter.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setDescription(java.lang.String description)
          Sets the description of this parameter.
 void setName(java.lang.String name)
          Sets the name of the parameter.
 void setParameterName(java.lang.String parameterName)
          Sets the mapped parameter name.
 void setPrivate(boolean isPrivate)
          Sets the parameter visibility.
 void setType(int t)
          Sets the type of the parameter.
 void setValue(java.lang.Object value)
          Sets the parameter value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
The value of that constant is the XML tag name of the parameter.

See Also:
Constant Field Values
Constructor Detail

ParameterModel

public ParameterModel()
Builds an empty ParameterModel.


ParameterModel

public ParameterModel(java.lang.String name,
                      java.lang.String description,
                      int type,
                      java.lang.Object value,
                      boolean isPrivate,
                      java.lang.String parameterName)
Builds a ParameterModel.

Parameters:
name - name of the parameter.
description - description of the parameter.
type - the type of the parameter according to constants described below.
value - the value of the parameter.
isPrivate - the visibility of the parameter.
parameterName - the name of the mapped parameter.

ParameterModel

public ParameterModel(java.lang.String name,
                      int type,
                      boolean isPrivate)
Builds a ParameterModel.

Parameters:
name - name of the parameter.
type - the type of the parameter according to constants described below.
isPrivate - the visibility of the parameter.
Method Detail

getName

public java.lang.String getName()
Returns the name of the parameter.

Returns:
The parameter name.

setName

public void setName(java.lang.String name)
Sets the name of the parameter.

Parameters:
name -

getType

public int getType()
Returns the type of the parameter. The returned types are :

Returns:
the parameter type.

setType

public void setType(int t)
Sets the type of the parameter. The allowed types are :

Parameters:
t - the parameter type.

getDescription

public java.lang.String getDescription()
Returns the description of this parameter.

Returns:
This parameter description.
See Also:
setDescription(String)

setDescription

public void setDescription(java.lang.String description)
Sets the description of this parameter.

Parameters:
description -
See Also:
getDescription()

getValue

public java.lang.Object getValue()
Returns the parameter value.

Returns:
the parameter value.

setValue

public void setValue(java.lang.Object value)
Sets the parameter value.

Parameters:
value - the parameter value.

getStringValue

public java.lang.String getStringValue()
Returns the parameter default value seen as a String if it is possible.

Returns:
the parameter value seen as a String.

getNumberValue

public java.math.BigDecimal getNumberValue()
Returns the parameter default value seen as a BigDecimal if it is possible.

Returns:
the parameter default value seen as a BigDecimal.

getDateValue

public java.util.Date getDateValue()
Returns the parameter default value seen as a Date if it is possible.

Returns:
the parameter value seen as a Date.

getParameterName

public java.lang.String getParameterName()
Returns the mapped parameter name. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.

Returns:
the name of the mapped parameter.

setParameterName

public void setParameterName(java.lang.String parameterName)
Sets the mapped parameter name. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.

Parameters:
parameterName - the name of the mapped parameter.

isPrivate

public boolean isPrivate()
Returns the visibility of the parameter.

Returns:
true if the parameter is private.

setPrivate

public void setPrivate(boolean isPrivate)
Sets the parameter visibility.

Parameters:
isPrivate - the level of the visibility.

checkValidity

public boolean checkValidity()
Tests if the parameter is valid (non void name, incompatible type, value...).

Returns:
true if the parameter is valid, false otherwise.

duplicate

public ParameterModel duplicate()
Returns a clone of the parameter.

Returns:
the clone of the parameter.

getAdditionalInfoList

public java.util.List<AdditionalInfoModel> getAdditionalInfoList()
Gets the list of Additional Informations.

Returns:
The list of Additional Informations

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String name,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
name - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)